import VueRouter from "../vue-router/index";
import Home from "";
import A from "";
import B from "";

Vue.use(VueRouter);

export const routes = [
  {
    path: '/',
    component: Home,
  },
  {
    path: '/home',
    component: Home,
    children: [
      {
        path: 'a',
        component: A
      },
      {
        path: 'b',
        component: B
      }
    ]
  }
];

const router = new VueRouter({
  routes,
  mode: 'hash'
})

router.beforeEach((from, to, next) => {
  console.log(111);
  next();
})
router.beforeEach((from, to, next) => {
  console.log(222);
  next();
})

export default router;